/**
 * Created with IntelliJ IDEA.
 * Description:不规则数组
 * User: dings
 * Date: 2024-05-10
 * Time: 10:16
 */
public class Test {
    public static void main(String[] args) {

        /*
          不规则数组
         */
        int[][] array = new int[2][];
        //array[0] = {1,2,3,4,5};
        array[0] = new int[]{100,99,98,97};
        array[1] = new  int[]{96,95,94};
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }

        System.out.println("============");

        int[][] array2 = new int[][]{{1,2},{3,4},{5,6,7}};
        for (int[] tmp:array2) {
            for (int x:tmp) {
                System.out.print(x+" ");
            }
            System.out.println();
        }
    }
}
